package genalgoritm.mediators;

import genalgoritm.count.RealChromosome;

import java.util.ArrayList;
import java.util.List;

public class ModelProvider {
	private static ModelProvider content;
	private List<RealChromosome> persons;

	private ModelProvider() {
		persons = new ArrayList<RealChromosome>();
		// Image here some fancy database access to read the persons and to
		// put them into the model
		RealChromosome person;
		person = new RealChromosome(0);
		persons.add(person);
		person = new RealChromosome(1);
		persons.add(person);
		person = new RealChromosome(2);
		persons.add(person);
		person = new RealChromosome(3);
		persons.add(person);
		person = new RealChromosome(4);
		persons.add(person);

	}

	public static synchronized ModelProvider getInstance() {
		if (content != null) {
			return content;
		}
		content = new ModelProvider();
		return content;
	}

	public List<RealChromosome> getPersons() {
		return persons;
	}

}
